package com.kantboot.business.bp.repository;

import com.kantboot.business.bp.domain.entity.BusBpGrade;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface BusBpGradeRepository extends JpaRepository<BusBpGrade, Long> {

    @Query("""
    FROM BusBpGrade ORDER BY level ASC
    """)
    List<BusBpGrade> findAll();

    /**
     * 获取年级数据
     * @return 年级数据 按照年级的等级排序
     */
    @Query("""
    FROM BusBpGrade
    ORDER BY level ASC
    """)
    Page<BusBpGrade> getBodyData(Pageable pageable);

}
